<header id="topbar" class="">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="#stats/channel_stat/">渠道数据统计</a>
            </li>
        </ol>
    </div>
      <div class="topbar-right">
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>
</header>


<section id="content" class="animated fadeIn">
    <% if(overview.length>0){ %>
    <div class="panel overflow">
        <table class="table table-striped fs13" id="main-list">
            <thead>
            <tr class="bg-light">
                <th>通道ID</th>
                <th>通道名称</th>
                <th>支付总金额(元)</th>
                <th>支付总笔数</th>
            </tr>
            </thead>
            <tbody class="admin-form">
            <% var total = 0, count = 0;
            _.each(overview, function(obj){
            total += obj.total;
            count += obj.count;
            %>
            <tr data-id="<%= obj.channel_id %>">
                <td class=""><%= obj.channel_id %></td>
                <td class=""><%= obj.channel_name %></td>
                <td class=""><%= obj.total %></td>
                <td class=""><%= obj.count %></td>
            </tr>
            <%}) %>
            </tbody>
        </table>
    </div>

    <h5 class="title-divider text-muted mb20">总计<span class="pull-right text-danger"> <%= total.toFixed(2) %>/<%= count %>次 </span>
    </h5>
    <% }else{ %>
    <h4 class="text-muted">无数据</h4>
    <% } %>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
 <div class="sidebar_right_content nano-content">
     <div class="tab-block sidebar-block br-n">
        <ul class="nav nav-tabs tabs-border nav-justified">
            <li>
                <a href="#sidebar-right-tab1" data-toggle="tab" aria-expanded="true">过滤搜索</a>
            </li>
        </ul>
        <div class="tab-content br-n">
            <div id="sidebar-right-tab1" class="active">
                    <h6 class="fw400">商户编号</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchMchId" name="searchMchId" data-field="mch_id">
                                <option value="-1" <%= searched.mch_id == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(mchs, function(mch){ %>
                                    <option value="<%= mch.id %>" <%= searched.mch_id == mch.id ? 'selected' : '' %>><%= mch.name %>(<%= mch.id %>)</option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>
                    <% var tf = searched.time_field || 'created_at',
                        title = '下单时间(点击切换)';
                        if(tf == 'updated_at')title = '到账时间(点击切换)';  %>
                    <h6 class="fw400" id="switchSearchTime"><%= title %></h6>
                    <div class="section row" id="searchCreatedAt" <%= tf == 'created_at' ? '' : 'hidden' %>>
                        <div class="col-md-6">
                                <input type="text" title="下限，包含当天" name="searchCreatedAtLower" id="searchCreatedAtLower" class="gui-input" data-type="date" value="<%= searched.created_at_lower %>">
                                </label>
                            </label>
                        </div>
                        <div class="col-md-6">
                                <input type="text" title="上限，不包括当天" name="searchCreatedAtUpper" id="searchCreatedAtUpper" class="gui-input" data-type="date" value="<%= searched.created_at_upper %>">
                                </label>
                            </label>
                        </div>
                    </div>
                    <div class="section row" id="searchUpdatedAt" <%= tf == 'updated_at' ? '' : 'hidden' %>>
                        <div class="col-md-6">
                                <input type="text" title="下限，包含当天" name="searchUpdatedAtLower" id="searchUpdatedAtLower" class="gui-input" data-type="date" value="<%= searched.updated_at_lower %>">
                                </label>
                            </label>
                        </div>
                        <div class="col-md-6">
                                <input type="text" title="上限，不包括当天" name="searchUpdatedAtUpper" id="searchUpdatedAtUpper" class="gui-input" data-type="date" value="<%= searched.updated_at_upper %>">
                                </label>
                            </label>
                        </div>
                    </div>
                    <h6 class="fw400">充值方式</h6>
                    <div class="section mb15">
                        <label class="field select">
                            <select id="searchChannelType" name="searchChannelType" data-field="channel_type">
                                <option value="-1" <%= searched.channel_type == -1 ? 'selected' : '' %>>所有</option>
                                <% _.each(CHANNEL_TYPE, function(v, k){%>
                                    <option value="<%= k %>" searched.channel_type == k ? 'selected': 0><%= v %></option>
                                <% }) %>
                            </select>
                            <i class="arrow double"></i>
                        </label>
                    </div>

                    <hr class="short">

                    <button class="btn btn-default btn-block" type="button" id="search">搜索</button>

                </div>
            </div>
        </div>
     </div>
 </div>

</aside>
<!-- End: Right Sidebar -->
